<p class="Paragraph"><help:to-be-embedded Eid="datenbanktext" xmlns:help="http://openoffice.org/2000/help">This section deals with functions used with row data that has been merged into records.</help:to-be-embedded> The following functions are covered: <help:link Id="66856" Eid="dbanzahl" xmlns:help="http://openoffice.org/2000/help">DCOUNT</help:link>, <help:link Id="66856" Eid="dbanzahl2" xmlns:help="http://openoffice.org/2000/help">DCOUNTA</help:link>, <help:link Id="66856" Eid="dbauszug" xmlns:help="http://openoffice.org/2000/help">DGET</help:link>, <help:link Id="66856" Eid="dbmax" xmlns:help="http://openoffice.org/2000/help">DMAX</help:link>, <help:link Id="66856" Eid="dbmin" xmlns:help="http://openoffice.org/2000/help">DMIN</help:link>, <help:link Id="66856" Eid="dbmittelwert" xmlns:help="http://openoffice.org/2000/help">DAVERAGE</help:link>, <help:link Id="66856" Eid="dbprodukt" xmlns:help="http://openoffice.org/2000/help">DPRODUCT</help:link>, <help:link Id="66856" Eid="dbstdabw" xmlns:help="http://openoffice.org/2000/help">DSTDEV</help:link>, <help:link Id="66856" Eid="dbstdabwn" xmlns:help="http://openoffice.org/2000/help">DSTDEVP</help:link>, <help:link Id="66856" Eid="dbsumme" xmlns:help="http://openoffice.org/2000/help">DSUM</help:link>, <help:link Id="66856" Eid="dbvarianz" xmlns:help="http://openoffice.org/2000/help">DVAR</help:link>, <help:link Id="66856" Eid="dbvarianzen" xmlns:help="http://openoffice.org/2000/help">DVARP</help:link>. They are described below in the order indicated. Call page two of AutoPilot: Functions to compare the function descriptions.</p>
<p class="Paragraph">The <span class="T1">Database</span> category may be confused with a database integrated in <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname>. However, there is no connection between a database in <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> and the <span class="T1">Database</span> category in <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Calc.</p>
</span></th></tr></table>
<p class="Paragraph"/>
<p class="Paragraph">Look at the example. The range A1:E10 lists the children invited to Joe's birthday. The following information is given for each entry: column A shows the name, B the grade, then age in years, distance to school in meters and weight in kilograms.</p>
<p class="Paragraph">The formula in cell B16 is =DCOUNT(A1:E10;A1:E10;A13:E14)</p>
<p class="Paragraph">Following are the parameter definitions for all database functions:</p>
<p class="Paragraph"><span class="T1">Database</span> is the cell range defining the database.</p>
<p class="Paragraph"><span class="T1">Database Field</span> indicates the database field used for further reference if such referencing is possible in a database function. To reference a column by means of the column header name, place quotation marks around the latter.</p>
<p class="Paragraph"><span class="T1">Search Criteria</span> is the cell range containing search criteria. If you write several criteria in one row they are connected by AND. If you write the criteria in different rows they are connected by OR. Empty cells in the search criteria range will be ignored.</p>
<p class="Paragraph">Choose <help:link Id="66267" xmlns:help="http://openoffice.org/2000/help">Tools - Options - Spreadsheet - Calculate</help:link> to define how <help:productname xmlns:help="http://openoffice.org/2000/help">%PRODUCTNAME</help:productname> Calc is to act when searching for identical entries.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DCOUNT counts the number of rows (records) in a database that match the specified search criteria and contain numerical values.</help:help-text></p>
<p class="Paragraph">For the median parameter you can enter the entire database or the number zero, but the parameter cannot be empty.</p>
<p class="Head3">Example</p>
<p class="Paragraph">In the example above, we want to know how many children have to travel more than 600 meters to school. The result is to be stored in cell B16. Set the cursor in cell B16. Enter the formula =DCOUNT(A1:E10;A1:E10;A13:E14) in B16. Alternatively enter =DCOUNT(A1:E10;0;A13:E14) (see syntax note above). The AutoPilot: Functions supports range entries.</p>
<p class="Paragraph"><span class="T1">Database</span> is the range of data to be evaluated, including its headers: in this case A1:E10. <span class="T1">Database Field</span> specifies the column for the search criteria: in this case, Distance to School (meters). <span class="T1">Search Criteria</span> is the range where you can enter the search parameters: in this case, A13:E14.</p>
<p class="Paragraph">For example, to learn how many children in second grade are over 7 years of age, delete the entry >600 in cell D14 and enter "2" in cell B14 under Grade, and enter >7 in cell C14 to the right. The result is 2. Two children are in second grade and over 7 years of age. As both criteria are in the same row they are connected by AND.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DCOUNTA counts the number of rows (records) in a database that match the specified search conditions, and contain numeric or alphanumeric values.</help:help-text></p>
<p class="Paragraph">In the example above, you can search for the number of children whose name starts with an E or a subsequent letter. Edit the formula in B16 by inserting an A after the function name DCOUNT. Delete the old search criteria and enter >=E under <span class="T1">Name</span> in field A14. The result is 5. If you now delete all number values for Greta in row 8, the result changes to 4. Row 8 is no longer included in the count because it does not contain any values (the name Greta is text, not a value).</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DGET returns the contents of the referenced cell in a database which matches the specified search criteria.</help:help-text> In case of an error, the function returns either #VALUE! for no row found, or Err502 for more than one cell found.</p>
<p class="Paragraph">In the above example we want to determine what grade a child is in whose name we entered in cell A14. The formula is again entered in cell B16 and differs slightly from the earlier examples as only one column (one database field) can be entered for <span class="T1">Database Field</span>. Enter the following formula:</p>
<p class="Paragraph">Now enter the name Frank in A14, and you will see the result 2. Frank is in second grade. Enter "Age" instead of "Grade" and you will get Frank's age.</p>
<p class="Paragraph">Or enter a value in cell C14 only (e.g. 11) and delete the other entries in this row. Edit the formula in B16 as follows:</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DMAX returns the maximum content of a cell (field) in a database (all records) that matches the specified search conditions.</help:help-text></p>
<p class="Paragraph">Now, under 'Grade', enter 1, 2, 3, etc. one after the other. After entering a grade number the weight of the heaviest child in that grade appears.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DMIN returns the minimum content of a cell (field) in a database (all records) that matches the specified search criteria.</help:help-text></p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DAVERAGE returns the average of the values of all cells (fields) in all rows (database records) that match the specified search criteria.</help:help-text></p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DPRODUCT multiplies all cells of a data range where the cell contents match the search criteria.</help:help-text></p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DSTDEV calculates the standard deviation of a population based on a sample, using the numbers in a database column that match the given conditions.</help:help-text> The records are treated as a sample of data. That is "our" children represent a cross section of all children (a representative result can not be obtained from a sample of less than one thousand).</p>
<p class="Paragraph">In row 14, under Age, enter 7, 8, 9, etc. one after the other. The result shown is the standard deviation of the weight of all children of this age.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DSTDEVP calculates the standard deviation of a population based on all cells of a data range which match the search criteria.</help:help-text>The records are treated as the whole population. We, therefore, only want to make a statement about "our" children, not about others whose data we do not have.</p>
<p class="Paragraph">What is the standard deviation of the weight for all children of the same age at Joe's birthday party? Enter the following formula in B16:</p>
<p class="Paragraph">In row 14, under Age, enter 7, 8, 9, etc. one after the other. For each instance, the result is the standard deviation of the weight for all same-aged children whose weight we checked.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DSUM returns the total of all cells in a database field in all rows (records) that match the specified search criteria.</help:help-text></p>
<p class="Paragraph">How long is the combined distance to school of all children at Joe's birthday party who are in second grade? Enter the following formula in B16:</p>
<p class="Paragraph">=DSUM(A1:E10;"Distance to School";A13:E14)</p>
<p class="Paragraph">In row 14, under Grade, enter "2". As a result, you will see the sum of the distances to school of all the children who are in second grade, i.e. 1950.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DVAR returns the variance of all cells of a database field in all records which match the specified search criteria.</help:help-text> The records are treated as a sample of data, we want to make a statement about all children based on "our" children (a representative result cannot e obtained from a sample popuplation of less than one thousand).</p>
<p class="Paragraph">In row 14, under Age, enter 7, 8, 9, etc. one after the other. For each instance, you will see as a result the variance of the weight values for all children of this age.</p>
<p class="Paragraph"><help:help-text value="visible" xmlns:help="http://openoffice.org/2000/help">DVARP calculates the variance of all values in the cells of a database field in all records which match the specified search criteria.</help:help-text> The records are treated as an entire population, i.e. we want to make a statement about our children and not about children whose data has not been collected.</p>
<p class="Paragraph">What is the variance of the weight for all children of the same age at Joe's birthday party? Enter the following formula in B16:</p>
<p class="Paragraph">In row 14, under Age, enter 7, 8, 9, etc. one after the other. For each instance, the variance of the weight values for all children of this age attending Joe's birthday party appears.</p>